<?php
html::printPath(
    array('orgSeminar.form-title' => '/org/orgSeminar/all', $seminar['name'] => '')
);
$msg->printMessages();

echo '<ul class="commandList">';
echo '<li class="registrations2Li">' . html::anchor('/org/orgSeminar/registrationList?id=' . $seminar['id'], text::get('orgSeminar.registrationList')) . '</li>';
echo '</ul>';

echo '<h3>' . text::getEscaped('orgSeminar.seminarInfo') . '</h3>';

$fb = new FormBuilder('seminar', $seminar);
$fb->displayOnly();
$fb->text('name');
$fb->textarea('description');
$fb->spacer();
$fb->date('begin_date');
$fb->time('begin_time');
$fb->spacer();
$fb->date('end_date');
$fb->time('end_time');
$fb->spacer();
$fb->date('registration_deadline')->hint();
$fb->write();

if ($this->getAuthOrg('id') != Kohana::config('yosemin.onArrivalPaymentOrganizationId')) {
    echo '<h3>' . text::getEscaped('orgSeminar.paymentAcceptance') . '</h3>';

    echo '<ul class="commandList">';
    echo '<li class="editLi">' . html::anchor('/org/paymentAcceptance/edit?id=' . $seminar['id'], text::get('orgSeminar.editPaymentAcceptance')) . '</li>';
    echo '</ul>';

    if ($paymentAcceptance) {
        $fb = new FormBuilder('paymentAcceptance', $paymentAcceptance);
        $fb->displayOnly();
        $fb->date('deadline')->labelKey('paymentAcceptance.deadline')->hint();
        $fb->yesNoBox('accepts_cash')->styleClass('emphasized');
        if ($paymentAcceptance['accepts_cash']) {
            $fb->textarea('cash_notes');
        }
        $fb->delimiter();
        $fb->yesNoBox('accepts_bank_transfer')->styleClass('emphasized');
        if ($paymentAcceptance['accepts_bank_transfer']) {
            $fb->display('bank_account_id')->value($paymentAcceptance['bank_account']['name']);
            $fb->textarea('variable_symbol');
            $fb->textarea('bank_transfer_notes');
        }
        $fb->write();
    }
    else {
        echo text::getEscaped('paymentAcceptance.notSet');
    }
}
